
import Vue from 'vue'
import Vuex from 'vuex'


// 挂载Vuex
Vue.use(Vuex)

import {
	setStorage,
	getStorage
} from '../utils/storage.js';

// 创建VueX对象
const store = new Vuex.Store({
	state: {
		city: getStorage('city', 'session'),
        cityarr:getStorage('cityarr', 'session'),
	},
	mutations: {

		ADDDCITY(state, val) {
			console.log(state, val)
			state.city = val;
			setStorage('city', val, 'session')
		},

        ADDCITYARR(state, val) {
        	state.cityarr = val;
        	setStorage('cityarr', val, 'session')
        },

	},
	actions: {

	},
	getters: {

	}
})

export default store
